﻿// See https://aka.ms/new-console-template for more information
using CSharp.Study.Entity;
using CSharp.Study.Test;
using System.Text.RegularExpressions;

Console.WriteLine("Hello, World!");
集合取交集_并集_差集.Go();
string key = "a2_d";
bool pass = Regex.IsMatch(key, "^[_0-9a-zA-Z]{2-20}$");


string email = "2.48.3da嗷嗷@12a12消息.com";
bool isAPass = Regex.IsMatch(email, @"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$");
bool isPass = IsEmail(email);


var users = CSharp.Study.Entity.User.Users;
var groupdic = users.GroupBy(x => x.Age).ToDictionary(x => x.Key, x => x.ToList());


List<string> lista = new List<string>() { "Adsad", "Bdsad", "acc" };

string vsas = string.Join(',', lista.Select(x => x.Substring(0, 1).ToLower() + x.Substring(1)));


static bool IsEmail(string email)
{
    email = email ?? "";
    if (Regex.IsMatch(email, "\\s")) return false;
    var index1 = email.IndexOf('@');
    if (index1 <= 0) return false;
    var index2 = email.IndexOf('.', index1);
    if (index2 <= 0 || index2 < index1 + 2) return false;
    return true;
}

//JsonTestNew.Go();
//序号.Go();
//JsonTest.Go();
//模式匹配.Go();
//with表达式.Go();
//字符串操作.Go();
//语法练习.Go();
//ref关键字理解.Go();
//获取当前程序文件路径.Go();
//集合取交集_并集_差集.Go();
//异步练习.Go();
//计算字符串的UniCode编码.Go();
//foreach异步问题测试.Go();


bool dsa = Regex.IsMatch("312312a", @"^[0-9]*$");
Regex regex = new Regex("^[\u4e00-\u9fa5]*$");
bool res1= regex.IsMatch("dsajdhk");
bool res2 = regex.IsMatch("牛牛牛");
bool res3 = regex.IsMatch("牛牛牛eq312");

var datetime = default(DateTime).ToString();
List<string> list = new List<string>();
for (int i = 0; i < 20; i++)
{
    var guid = Guid.NewGuid().ToString("N");
    list.Add(guid);
}
string str = string.Join(',', list.ToArray());

var res = 1 == 0 ? "yes" : 1 == 1 ? "yes" : "no";

string value = "false";
string value2 = "true";

var v1 = Utils.ObjToBoolPython(value);
var v2 = Utils.ObjToBoolPython(value2);

Console.ReadKey();